feat(supermassive): early execution and merge#680
Open
pavelglac wants to merge 20 commits into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pavelglac
commented
Jul 3, 2026
| const incremental = getCompletedIncrementalResults(exeContext); | ||
| const batchTimeout = exeContext.enableIncrementalPayloadBatching; | ||
| const incremental = | ||
| batchTimeout !== undefined |
Contributor
Author
There was a problem hiding this comment.
@copilot it should typeof check for number.
Contributor
There was a problem hiding this comment.
Updated in 50a55c2: switched the batching guards to runtime number checks (typeof batchTimeout === "number") before using the timeout value.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds configurable optimizations to Supermassive’s incremental @defer execution to reduce perceived latency and reduce incremental payload churn, bringing behavior closer to GraphQL 17’s incremental execution.
Changes:
- Adds execution flags for early deferred-fragment execution, merging completed deferred payloads into the initial response, and timed batching of incremental payload emission.
- Implements deferred-fragment merge into the initial result (when possible) and optional timeout-based batching for subsequent incremental results.
- Adds a
getObjectAtPathhelper plus a dedicated test suite covering merge + batching behaviors forexecuteWithSchema.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/supermassive/src/types.ts | Adds new execution options controlling early defer execution, merge, and batching. |
| packages/supermassive/src/jsutils/getObjectAtPath.ts | New helper to locate an object/assign-target at a response path for merge. |
| packages/supermassive/src/executeWithSchema.ts | Plumbs new execution options through the schema-backed entrypoint. |
| packages/supermassive/src/executeWithoutSchema.ts | Core implementation: early patch execution, merge-into-initial-response, and incremental batching logic. |
| packages/supermassive/src/tests/executeWithSchema.test.ts | New tests covering merge behavior and batching behavior. |
| change/@graphitation-supermassive-8876a266-3c69-4f89-819b-4fc57b5b4470.json | Changeset entry for the Supermassive minor release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
335
to
345
| result = executeFields( | ||
| exeContext, | ||
| rootTypeName, | ||
| rootValue, | ||
| path, | ||
| groupedFieldSet, | ||
| undefined, | ||
| exeContext.enableEarlyExecution ? patches : undefined, | ||
| ); | ||
| result = buildResponse(exeContext, result); | ||
| break; |
Comment on lines
+260
to
+262
| enableEarlyExecution?: boolean; | ||
| enableDeferredMerge?: boolean; | ||
| enableIncrementalPayloadBatching?: number; |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds defer optimizations for Supermassive: